<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('game_h5_to_apk_config', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('H5转端apk条件配置');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('game_id')->comment('游戏id')->unsigned()->default(0);
            $table->integer('channel')->comment('渠道')->unsigned()->default(0);
            $table->integer('start_time')->comment('开始时间')->unsigned()->default(0);
            $table->integer('end_time')->comment('结束时间')->unsigned()->default(0);
            $table->tinyInteger('status')->comment('1开启 0关闭')->unsigned()->default(0);
            $table->integer('test_user_id')->comment('测试账号id')->unsigned()->default(0);
            $table->string('week_schedule', 350)->comment('开启时间段')->default('');
            $table->integer('role_level')->comment('角色等级要求')->unsigned()->default(0);
            $table->integer('total_pay')->comment('累计充值要求')->unsigned()->default(0);
            $table->integer('login_reg_day')->comment('登录-注册天数')->unsigned()->default(0);
            $table->integer('per')->comment('概率转端 万分比')->unsigned()->default(0);
            $table->string('device_list', 64)->comment('判断用户设备类型')->default('');
            $table->tinyInteger('type')->comment('转端方式 1弹出二维码链接 2弹出公告说明')->unsigned()->default(0);
            $table->string('show_qrcode_url', 512)->comment('弹出转端二维码图片')->default('');

            $table->index('game_id');
            $table->index('channel');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('game_h5_to_apk_config');
    }
};
